package com.gkzf.ai.module.system.controller.app.appUser.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalDateTime;

@Schema(description = "管理后台 - 用户新增/修改 Request VO")
@Data
public class UsersSaveReqVO {

    @Schema(description = "用户主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "13859")
    private Long id;

    @Schema(description = "用户名, 可选, 登录或显示用", example = "国科智飞")
    private String username;

    @Schema(description = "用户昵称, 来自微信或用户自定义", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
    @NotEmpty(message = "用户昵称, 来自微信或用户自定义不能为空")
    private String nickname;

    @Schema(description = "用户头像URL, 来自微信或用户自定义", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn")
    @NotEmpty(message = "用户头像URL, 来自微信或用户自定义不能为空")
    private String avatarUrl;

    @Schema(description = "性别, 0:未知, 1:男, 2:女", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "性别, 0:未知, 1:男, 2:女不能为空")
    private Boolean gender;

    @Schema(description = "手机号码, App登录主要凭证")
    private String mobile;

    @Schema(description = "密码, 存储bcrypt加密后的哈希值")
    private String password;

    @Schema(description = "微信UnionID, 跨应用唯一标识", example = "1285")
    private String unionId;

    @Schema(description = "微信小程序OpenID", example = "8693")
    private String mpOpenId;

    @Schema(description = "微信App开放平台OpenID", example = "16512")
    private String appOpenId;

    @Schema(description = "用户状态, 0:正常, 1:禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    @NotNull(message = "用户状态, 0:正常, 1:禁用不能为空")
    private Boolean status;

    @Schema(description = "注册来源, 1:小程序, 2:iOS App, 3:Android App, 4:Web", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "注册来源, 1:小程序, 2:iOS App, 3:Android App, 4:Web不能为空")
    private Boolean registerSource;

    @Schema(description = "最后登录时间")
    private LocalDateTime lastLoginTime;

    @Schema(description = "最后登录IP")
    private String lastLoginIp;

}